#ifndef BOARDCAIROVIEWER__H
#define BOARDCAIROVIEWER__H
#include "Board.h"
#include "BoardViewer.h"
#include <gtkmm/drawingarea.h>
#include <cairomm/context.h>
#include <gtkmm.h>
#include <queue>

class BoardCairoViewer: public BoardViewer, public Gtk::Table
{
public:
    BoardCairoViewer(Board&);
    virtual ~BoardCairoViewer();
    void draw();
    void update(int row, int col, Color);
private:
    class Chess:public Gtk::DrawingArea
    {
    public:
        Chess();
        void set_color(Color color);
        virtual bool on_expose_event(GdkEventExpose* event);        
    private:
        typedef Cairo::RefPtr<Cairo::Context> CR;        
        void draw_circle(CR);
        void draw_rectangle(CR);
        Color color_;        
    };    
    Chess matrix_[Board::ROWS+2][Board::COLS+2];
    Board& board_;
};

#endif

    
